<template>
  <div class="components-container">
    <!-- 编辑 -->
    <sweet-modal ref="dialog" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>{{title}}</h3>
      <el-button id="openVideo" type="primary" @click="PhotographUpload">打开视频</el-button>
      <el-button id="FileUpload" type="primary">清空缩略图</el-button>
      <el-button id="photograph" type="primary" @click="Photos">拍照</el-button>
      <div :style="{maxHeight:maxHeight+'px'}" style="overflow:auto;">
          <div style="width:640px;float:left;">
            <img id="big" width="640" height="480"/></img>
          </div>
          <div id="container" style="float:right;width:250px;height:480px;overflow:auto;"> </div>
      </div>
       <div>
        <select id="devList" style="width: 120px" ></select> 
        <select id="resolutionList" style="width: 120px" ></select> 
      </div>
      <div class="layui-form-item btnCenter">
        <el-button id="closeVideo" @click="closeDialog">取消</el-button>
        <el-button id="uploads" type="primary" @click="submit" :loading="this.$store.state.isloading">上传</el-button>
      </div>
    </sweet-modal>
  </div>
  </template>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/common.scss";
.el-button + .el-button {
  margin-left: 0;
}

.longtext {
  width: 480px;
}

.longertext {
  width: 480px;
}
.longertexts {
  width: 770px;
}

.sweet-btn {
  margin-top: 20px;
}

.layui-form-label[data-v-7e4f8d8c]{
  width: 82px;
}

.layui-form-labels[data-v-7e4f8d8c]{
  width: 100px;
  margin: 0;
}
</style>

<script>
import apiBase from "@/api/apiBase.js";
import {
  formatDate,
  timeStringToDate,
  dateStringToDate
} from "@/utils/date.js";
import sweetModal from "@/components/sweetModal";
import newscanWS from "@/utils/newscanWebSocket.js";
// import Appendixlist from "./Appendixlist";
import {
  MessageBox,
  Message
} from 'element-ui';

window.onload = function() {
  // Load();
};
window.onunload = function() {
  Unload();
};
// Vue.directives('focus',{
//   inserted: function (el) {
//        el.focus();
//     }
// });
export default {
  name: "AttachmentsUpload",
  data() {
    return {
      radio1: 3,
      radio2: 3,
      radio3: 3,
      pageWidth: 1000,
      maxHeight: 570,
      title: null,
      szlx: [],
      xblx: [],
      sfzjlx: [],
      isshowphoto: false,
    };
  },
  methods: {
     handleRemove(file, fileList) {
        console.log(file, fileList);
      },
      handlePreview(file) {
        console.log(file);
      },
    //拍照上传
    PhotographUpload(){
        // this.isshowphoto = true;
        // alert('我是拍照上传!!');

    },
        
    Photos(){
        console.log(8888);
    },
    //初始化下拉框数据
    initSelectData() {
      //初始化下拉框数据
      this.getCode();
      this.getCausa();
      this.getHousehold();
      this.getCar();
      this.getCreTypes();
      // this.getIce();
      this.getServiceTypes();
      this.getDrivers();
      this.getAddr();
      // this.getnoIce();
      this.getColumbarium();
      // this.gethallnumber();
    },
    //打开页面
    open(order, id, ids) {
      this.order = order;
      this.isshowphoto = ids;
      console.log(2);
      console.log(this.isshowphoto);
      this.maxHeight = window.innerHeight - 240;
      //清理数据
      console.log(25445);
      console.log(this.order);
      switch (this.order) {
        case "附件上传":
          this.title = '附件上传';
          this.$refs.dialog.open();
          break;
        default:
      }
    },
    //提交
    submit() {
      // this.$refs.Upload.operate(this.order,ORDER.FRCMBDID);
    },
    //取消按钮
    closeDialog() {
        // console.log(this.order);
      // if (
      //   this.order === ORDER.SELFREGISTER ||
      //   this.order === ORDER.REGISTER ||
      //   this.order === ORDER.MODIFY ||
      //   this.order === ORDER.BODYOUTAGE ||
      //   this.order === ORDER.BODYOUTAGES ||
      //   this.order === ORDER.ADD
      // )
        this.$refs.dialog.close();
        // this.$refs.dialogs.open('详情',this.isshowphoto);
      // else if (this.order === ORDER.INFO) this.$refs.dialogInfo.close();
    },
  
  
    refreshData() {
      this.$emit("refreshData");
    },
  },
  components: {
    sweetModal,
  },
  mounted() {//在模板渲染成html后调用，通常是初始化页面完成后，再对html的dom节点进行一些需要的操作。
   
  },
  created() {//在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图。
    // newscanWS.connects(message => {
    //   console.log(4545);
    //   console.log(message);
    // });
   
  },
 
};
</script>
